﻿<%@ Page Language="C#" MasterPageFile="~/GestorEventos.Master" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="GestorEventos.WebForm4" Title="Untitled Page" %>
<%@ Import Namespace="Business" %>
<%@ Import Namespace="System.Collections.Generic" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="UserArea" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Main" runat="server">
<table>
<tr>
    <td>
        Username
    </td>
    <td>
        Número Comentários
    </td>
</tr>
<%  
    Stats st = new Stats();
    List<Auxiliar> sl = st.getNrCommentsUser();
    Utilizador user = new Utilizador();
   // Response.Write(sl.GetKey(0));
   // Response.Write(sl.GetByIndex(0));

    for (int i = 0; i < sl.Count+1;i++ )
    {
      
    %>
    <tr>
    <td>
        <asp:Label ID="LabelNome" runat="server"></asp:Label>
        <%if(i==sl.Count)
              LabelNome.Text = user.getUtilizadorByID(sl[i-1].getUserID()).getUsername();
          else
                LabelNome.Text = user.getUtilizadorByID(sl[i].getUserID()).getUsername(); %>
    </td>
    <td>
        <asp:Label ID="LabelNr" runat="server"></asp:Label>
        
        <%if(i==sl.Count)
              LabelNr.Text = sl[i-1].getNrComments().ToString();
          else
            LabelNr.Text = sl[i].getNrComments().ToString(); %>    
    </td>
    <td>
    
    </td>
    
    </tr>
    


    
    <% 
    }
     %>
    
    </table>
    <table>
        <tr>
            <td>
                <asp:Label ID="Label1" runat="server"></asp:Label>
                <% Label1.Text=sl.Count.ToString(); %>
            </td>
        </tr>
    </table>
</asp:Content>

